from haystack import indexes
from ApiManager.models import ProjectInfo


class ProjectInfoIndex(indexes.SearchIndex, indexes.Indexable):
    """
    项目索引类
    """
    text = indexes.CharField(document=True, use_template=True)

    def get_model(self):
        return ProjectInfo

    def index_queryset(self, using=None):
        return self.get_model().objects.all()
